<template>
	<view class="protocol-page">
		<u-parse :content="content" :tagStyle="tagStyle"></u-parse>
	</view>
</template>

<script>
	import { getConfig } from '@/api/api'
	
	export default {
		data () {
			return {
				type: '',
				content: '',
				
				tagStyle: {
					span: 'text-wrap: wrap;'
				}
			}
		},
		onLoad (options) {
			this.type = options.type || ''
			
			this.loadData()
		},
		methods: {
			loadData () {
				getConfig().then(res => {
					if (res) {
						if (this.type == '1') {
							this.content = res.data.privacy_policy
						} else if (this.type == '2') {
							this.content = res.data.register_rule
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss">
.protocol-page {
	padding: 28rpx;
	/* #ifdef H5 */
	::v-deep {
		span {
			text-wrap: wrap !important;
		}
	}
	/* #endif */
}
</style>
